package tests;

import player.MachinePlayer;
import player.Minimax2;
import player.Move;
import board.Board;
import board.Piece;

public class MinimaxTests {

	public static void main(String[] args){
		testStep();
	}
	
	public static void testStep(){
		Board b = new Board();
		b.makeMove(new Move(4,0), Piece.BLACK);
		b.makeMove(new Move(2,1), Piece.BLACK);
		b.makeMove(new Move(3,2), Piece.BLACK);
		b.makeMove(new Move(5,2), Piece.BLACK);
		b.makeMove(new Move(6,3), Piece.BLACK);
		b.makeMove(new Move(2,4), Piece.BLACK);
		b.makeMove(new Move(3,5), Piece.BLACK);
		b.makeMove(new Move(5,5), Piece.BLACK);
		b.makeMove(new Move(6,6), Piece.BLACK);
		b.makeMove(new Move(1,7), Piece.BLACK);
		
		b.makeMove(new Move(1,1), Piece.WHITE);
		b.makeMove(new Move(6,1), Piece.WHITE);
		b.makeMove(new Move(2,2), Piece.WHITE);
		b.makeMove(new Move(4,2), Piece.WHITE);
		b.makeMove(new Move(5,3), Piece.WHITE);
		b.makeMove(new Move(1,4), Piece.WHITE);
		b.makeMove(new Move(2,5), Piece.WHITE);
		b.makeMove(new Move(4,5), Piece.WHITE);
		b.makeMove(new Move(0,6), Piece.WHITE);
		b.makeMove(new Move(5,6), Piece.WHITE);
		
		Move m = Minimax2.chooseMove(b, Piece.BLACK, 3);
		System.out.println(b);
		System.out.println(m);
		
		MachinePlayer mp = new MachinePlayer(Piece.WHITE,4);
		//black moves
		mp.opponentMove(new Move(4,0));
		mp.opponentMove(new Move(2,1));
		mp.opponentMove(new Move(3,2));
		mp.opponentMove(new Move(5,2));
		mp.opponentMove(new Move(6,3));
		mp.opponentMove(new Move(2,4));
		mp.opponentMove(new Move(3,5));
		mp.opponentMove(new Move(5,5));
		mp.opponentMove(new Move(6,6));
		mp.opponentMove(new Move(1,7));
		
		//white moves
		mp.forceMove(new Move(1,1));
		mp.forceMove(new Move(6,1));
		mp.forceMove(new Move(2,2));
		mp.forceMove(new Move(4,2));
		mp.forceMove(new Move(5,3));
		mp.forceMove(new Move(1,4));
		mp.forceMove(new Move(2,5));
		mp.forceMove(new Move(4,5));
		mp.forceMove(new Move(0,6));
		mp.forceMove(new Move(5,6));
		
		System.out.println(mp.chooseMove());
	}
	
}
